<h2>Problem 287</h2>
<div style="color:#666;font-size:80%;">10 April 2010</div><br />
<div class="problem_content">
<p>The quadtree encoding allows us to describe a 2<img src="" style="display:none;" alt="^(" /><sup><var>N</var></sup><img src="" style="display:none;" alt=")" /><img src='images/symbol_times.gif' width='9' height='9' alt='&times;' border='0' style='vertical-align:middle;' />2<img src="" style="display:none;" alt="^(" /><sup><var>N</var></sup><img src="" style="display:none;" alt=")" />  black and white image as a sequence of bits (0 and 1). Those sequences are to be read from left to right like this:
<ul><li>the first bit deals with the complete 2<img src="" style="display:none;" alt="^(" /><sup><var>N</var></sup><img src="" style="display:none;" alt=")" /><img src='images/symbol_times.gif' width='9' height='9' alt='&times;' border='0' style='vertical-align:middle;' />2<img src="" style="display:none;" alt="^(" /><sup><var>N</var></sup><img src="" style="display:none;" alt=")" /> region;</li>
<li>"0" denotes a split:
<br />the current 2<img src="" style="display:none;" alt="^(" /><sup><var>n</var></sup><img src="" style="display:none;" alt=")" /><img src='images/symbol_times.gif' width='9' height='9' alt='&times;' border='0' style='vertical-align:middle;' />2<img src="" style="display:none;" alt="^(" /><sup><var>n</var></sup><img src="" style="display:none;" alt=")" /> region is divided into 4 sub-regions of dimension 2<img src="" style="display:none;" alt="^(" /><sup><var>n</var>-1</sup><img src="" style="display:none;" alt=")" /><img src='images/symbol_times.gif' width='9' height='9' alt='&times;' border='0' style='vertical-align:middle;' />2<img src="" style="display:none;" alt="^(" /><sup><var>n</var>-1</sup><img src="" style="display:none;" alt=")" />,<br />
the next bits contains the description of the top left, top right, bottom left and bottom right sub-regions - in that order;</li>
<li>"10" indicates that the current region contains only black pixels;</li>
<li>"11" indicates that the current region contains only white pixels.</li></ul></p>

<p>Consider the following 4<img src='images/symbol_times.gif' width='9' height='9' alt='&times;' border='0' style='vertical-align:middle;' />4 image (colored marks denote places where a split can occur):</p>
<div align='center'><img src="project/images/p_287_quadtree.gif" /></div>
<p>This image can be described by several sequences, for example :<bp />
"<span style='color:red;'><b>0</b></span><span style='color:blue;'><b>0</b></span>10101010<span style='color:green;'><b>0</b></span>1011111011<span style='color:orange;'><b>0</b></span>10101010", of length 30, or<br />
"<span style='color:red;'><b>0</b></span>10<span style='color:green;'><b>0</b></span>101111101110", of length 16, which is the minimal sequence for this image.</p>

<p>For a positive integer <var>N</var>, define <var>D<img src="" style="display:none;" alt="_(" /><sub>N</sub><img src="" style="display:none;" alt=")" /></var> as the 2<img src="" style="display:none;" alt="^(" /><sup><var>N</var></sup><img src="" style="display:none;" alt=")" /><img src='images/symbol_times.gif' width='9' height='9' alt='&times;' border='0' style='vertical-align:middle;' />2<img src="" style="display:none;" alt="^(" /><sup><var>N</var></sup><img src="" style="display:none;" alt=")" /> image with the following coloring scheme:
<ul><li>the pixel with coordinates <var>x</var>&thinsp;=&thinsp;0, <var>y</var>&thinsp;=&thinsp;0 corresponds to the bottom left pixel,</li>
<li>if (<var>x</var>&thinsp;-&thinsp;2<img src="" style="display:none;" alt="^(" /><sup><var>N</var>-1</sup><img src="" style="display:none;" alt=")" />)<img src="" style="display:none;" alt="^(" /><sup>2</sup><img src="" style="display:none;" alt=")" />&thinsp;+&thinsp;(<var>y</var>&thinsp;-&thinsp;2<img src="" style="display:none;" alt="^(" /><sup><var>N</var>-1</sup><img src="" style="display:none;" alt=")" />)<img src="" style="display:none;" alt="^(" /><sup>2</sup><img src="" style="display:none;" alt=")" />&thinsp;<img src='images/symbol_le.gif' width='10' height='12' alt='&le;' border='0' style='vertical-align:middle;' />&thinsp;2<img src="" style="display:none;" alt="^(" /><sup>2<var>N</var>-2</sup><img src="" style="display:none;" alt=")" /> then the pixel is black,</li>
<li>otherwise the pixel is white.</li></ul></p>

<p>What is the length of the minimal sequence describing <var>D</var><img src="" style="display:none;" alt="_(" /><sub>24</sub><img src="" style="display:none;" alt=")" />&thinsp;?</p>
</div><br />
